package com.atguigu.gmall.feign.list;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.list.Goods;
import com.atguigu.gmall.model.list.SearchParam;
import com.atguigu.gmall.model.vo.GoodsSearchResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 卡尼奶
 * @Date 2022/5/28 14:27
 * @Version 1.0
 */
@RequestMapping("/rpc/product")
@FeignClient("service-list")
public interface SearchFeignClient {

    @PostMapping("/list/save")
    public Result searchProduct(@RequestBody Goods goods);

    @DeleteMapping("/list/delete/{id}")
    public Result deleteSearchProduct(@PathVariable("id") Long id);


    /**
     * 检索商品
     *
     * @param param
     * @return
     */
    @PostMapping("/goods/search")
    public Result<GoodsSearchResultVo> searchGoods(@RequestBody SearchParam param);


    @GetMapping("/goods/incrHotScore/{skuId}")
    public Result incrHotScore(@PathVariable("skuId") Long skuId,
                               @RequestParam("score") Long score);
}
